<template>
  <view class="page">
    <view class="tcard">
      <view class="title flexR">
        王晴晴
        <view class="tig_status success">
          已出院
        </view>
      </view>
      <view class="tform no-border left">
        <view class="tform-item">
          <view class="label aling">住院号：</view>
          <view class="value">000123032420</view>
        </view>
        <view class="tform-item">
          <view class="label aling">入院病区：</view>
          <view class="value">内科中心病区</view>
        </view>
        <view class="tform-item">
          <view class="label aling">入院科室：</view>
          <view class="value">门诊内一科</view>
        </view>
        
        <view class="line"></view>
        
        <view class="tform-item">
          <view class="label value aling">费用日期：</view>
          <view class="value" style="flex: 1;">
            {{date}}
            <view class="switch" @click="showCalender = true">
              <img class="switch-icon" :src="`${$store.state.baseApi}/icon/switch.png`" alt="">
              切换日期
            </view>
          </view>
        </view>
      </view>
      
      <view class="line"></view>
      <view class="money-box">
        费用合计：<text class="money red">- 234.77</text>
      </view>
    </view>
    
    <view class="tcard detail">
      <view class="title">
        费用明细
      </view>
      <view class="tform">
        <view class="tform-item" @click="toDailyDetail">
          <view class="value">项目名称</view>
          <view class="value">单价</view>
          <view class="value">单价</view>
          <view class="value">单价</view>
        </view>
        <view class="tform-item" @click="toDailyDetail">
          <view class="value">住院诊查费</view>
          <view class="value">￥20.00</view>
          <view class="value">×1</view>
          <view class="value">￥20.00</view>
        </view>
        <view class="tform-item" @click="toDailyDetail">
          <view class="value">住院诊查费</view>
          <view class="value">￥20.00</view>
          <view class="value">×1</view>
          <view class="value">￥20.00</view>
        </view>
        <view class="tform-item" @click="toDailyDetail">
          <view class="value">住院诊查费住院诊查费</view>
          <view class="value">￥20.00</view>
          <view class="value">×1</view>
          <view class="value">￥20.00</view>
        </view>
      </view>
    </view>
    
    <u-calendar v-model="showCalender" mode="date" maxDate="2030-12-31" @change="changeDate"/>
  </view>
</template>

<script>
  import { mapGetters } from 'vuex';
  export default {
    data() {
      return {
        showCalender:true,
        date: '2024-06-07'
      }
    },
    computed:{
    	...mapGetters(['userInfo']),
    },
    methods: {
      changeDate(obj) {
        this.date = obj.result
      },
      toDailyDetail() {
        uni.navigateTo({
          url: `./dailyDetail`
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
.title {
  justify-content: space-between;
}
.align {
  width: 5em;
  text-align: justify;
  text-align-last: justify;
}
.line {
  margin: 16upx 0;
}
.money-box {
  text-align: right;
  // margin-top: 24upx;
}
.money {
  font-family: PingFang SC, PingFang SC;
  font-weight: bold;
  font-size: 36upx;
  color: $theme-color;
}
.u-icon {
  color: rgba(0,0,0,0.4);
}
.detail {
  .tform-item {
    >view {
      // max-width: 200upx;
      width: 23%;
      &:nth-child(1) {
        width: 30%;
      }
      &:nth-last-child(1) {
        font-weight: 700;
      }
    }
    &:nth-child(1) {
      font-weight: 700;
    }
  }
}
.switch {
  display: flex;
  align-items: center;
  float: right;
  color: $theme-color;
  .switch-icon {
    width: 32upx;
    height: 32upx;
  }
}

</style>
